home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 June: Reference Library / Dev.CD Jun 95 / Dev.CD Jun 95.toast / What's New? / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / AEObjects.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  7.6 KB  |  253 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AEObjects.a
  3. ;
  4. ;    Contains:    AppleEvents Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__AEOBJECTS__') = 'UNDEFINED' THEN
  21. __AEOBJECTS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  25.     include 'Memory.a'
  26.     ENDIF
  27. ;        include 'Types.a'                                            ;
  28. ;            include 'ConditionalMacros.a'                            ;
  29. ;        include 'MixedMode.a'                                        ;
  30.  
  31.     IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
  32.     include 'OSUtils.a'
  33.     ENDIF
  34.  
  35.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  36.     include 'Quickdraw.a'
  37.     ENDIF
  38. ;        include 'QuickdrawText.a'                                    ;
  39.  
  40.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  41.     include 'Events.a'
  42.     ENDIF
  43.  
  44.     IF &TYPE('__EPPC__') = 'UNDEFINED' THEN
  45.     include 'EPPC.a'
  46.     ENDIF
  47. ;        include 'Errors.a'                                            ;
  48. ;        include 'AppleTalk.a'                                        ;
  49. ;        include 'Files.a'                                            ;
  50. ;        include 'PPCToolbox.a'                                        ;
  51. ;        include 'Processes.a'                                        ;
  52.  
  53.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  54.     include 'AppleEvents.a'
  55.     ENDIF
  56. ;        include 'Notification.a'                                    ;
  57.  
  58.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  59.     include 'Errors.a'
  60.     ENDIF
  61.  
  62. kAEAND                            EQU        'AND '                ;  0x414e4420  
  63. kAEOR                            EQU        'OR  '                ;  0x4f522020  
  64. kAENOT                            EQU        'NOT '                ;  0x4e4f5420  
  65. ;***    ABSOLUTE ORDINAL CONSTANTS    ***
  66. kAEFirst                        EQU        'firs'                ;  0x66697273  
  67. kAELast                            EQU        'last'                ;  0x6c617374  
  68. kAEMiddle                        EQU        'midd'                ;  0x6d696464  
  69. kAEAny                            EQU        'any '                ;  0x616e7920  
  70. kAEAll                            EQU        'all '                ;  0x616c6c20  
  71. ;***    RELATIVE ORDINAL CONSTANTS    ***
  72. kAENext                            EQU        'next'                ;  0x6e657874  
  73. kAEPrevious                        EQU        'prev'                ;  0x70726576  
  74. ;***    KEYWORD CONSTANT     ***
  75. keyAECompOperator                EQU        'relo'                ;  0x72656c6f  
  76. keyAELogicalTerms                EQU        'term'                ;  0x7465726d  
  77. keyAELogicalOperator            EQU        'logc'                ;  0x6c6f6763  
  78. keyAEObject1                    EQU        'obj1'                ;  0x6f626a31  
  79. keyAEObject2                    EQU        'obj2'                ;  0x6f626a32  
  80. ;    ... for Keywords for getting fields out of object specifier records. 
  81. keyAEDesiredClass                EQU        'want'                ;  0x77616e74  
  82. keyAEContainer                    EQU        'from'                ;  0x66726f6d  
  83. keyAEKeyForm                    EQU        'form'                ;  0x666f726d  
  84. keyAEKeyData                    EQU        'seld'
  85.  
  86. ;    ... for Keywords for getting fields out of Range specifier records. 
  87. keyAERangeStart                    EQU        'star'                ;  0x73746172  
  88. keyAERangeStop                    EQU        'stop'                ;  0x73746f70  
  89. ;    ... special handler selectors for OSL Callbacks. 
  90. keyDisposeTokenProc                EQU        'xtok'                ;  0x78746f6b  
  91. keyAECompareProc                EQU        'cmpr'                ;  0x636d7072  
  92. keyAECountProc                    EQU        'cont'                ;  0x636f6e74  
  93. keyAEMarkTokenProc                EQU        'mkid'                ;  0x6d6b6964  
  94. keyAEMarkProc                    EQU        'mark'                ;  0x6d61726b  
  95. keyAEAdjustMarksProc            EQU        'adjm'                ;  0x61646a6d  
  96. keyAEGetErrDescProc                EQU        'indc'
  97.  
  98. ;***    VALUE and TYPE CONSTANTS    ***
  99. ;    ... possible values for the keyAEKeyForm field of an object specifier. 
  100. formAbsolutePosition            EQU        'indx'                ;  0x696e6478  
  101. formRelativePosition            EQU        'rele'                ;  0x72656c65  
  102. formTest                        EQU        'test'                ;  0x74657374  
  103. formRange                        EQU        'rang'                ;  0x72616e67  
  104. formPropertyID                    EQU        'prop'                ;  0x70726f70  
  105. formName                        EQU        'name'                ;  0x6e616d65  
  106. ;    ... relevant types (some of these are often pared with forms above). 
  107. typeObjectSpecifier                EQU        'obj '                ;  0x6f626a20  
  108. typeObjectBeingExamined            EQU        'exmn'                ;  0x65786d6e  
  109. typeCurrentContainer            EQU        'ccnt'                ;  0x63636e74  
  110. typeToken                        EQU        'toke'                ;  0x746f6b65  
  111. typeRelativeDescriptor            EQU        'rel '                ;  0x72656c20  
  112. typeAbsoluteOrdinal                EQU        'abso'                ;  0x6162736f  
  113. typeIndexDescriptor                EQU        'inde'                ;  0x696e6465  
  114. typeRangeDescriptor                EQU        'rang'                ;  0x72616e67  
  115. typeLogicalDescriptor            EQU        'logi'                ;  0x6c6f6769  
  116. typeCompDescriptor                EQU        'cmpd'                ;  0x636d7064  
  117. typeOSLTokenList                EQU        'ostl'
  118.  
  119. ; Possible values for flags parameter to AEResolve.  They're additive 
  120. kAEIDoMinimum                    EQU        $0000
  121. kAEIDoWhose                        EQU        $0001
  122. kAEIDoMarking                    EQU        $0004
  123. kAEPassSubDescs                    EQU        $0008
  124. kAEResolveNestedLists            EQU        $0010
  125. kAEHandleSimpleRanges            EQU        $0020
  126. kAEUseRelativeIterators            EQU        $0040
  127.  
  128. ;*** SPECIAL CONSTANTS FOR CUSTOM WHOSE-CLAUSE RESOLUTION 
  129. typeWhoseDescriptor                EQU        'whos'                ;  0x77686f73  
  130. formWhose                        EQU        'whos'                ;  0x77686f73  
  131. typeWhoseRange                    EQU        'wrng'                ;  0x77726e67  
  132. keyAEWhoseRangeStart            EQU        'wstr'                ;  0x77737472  
  133. keyAEWhoseRangeStop                EQU        'wstp'                ;  0x77737470  
  134. keyAEIndex                        EQU        'kidx'                ;  0x6b696478  
  135. keyAETest                        EQU        'ktst'
  136.  
  137. ;*
  138. ;    used for rewriting tokens in place of 'ccnt' descriptors
  139. ;    This record is only of interest to those who, when they...
  140. ;    ...get ranges as key data in their accessor procs, choose
  141. ;    ...to resolve them manually rather than call AEResolve again.
  142. ;*
  143. ccntTokenRecord         RECORD    0
  144. tokenClass                 ds.l   1        ; offset: $0 (0)
  145. token                     ds     AEDesc    ; offset: $4 (4)
  146. sizeof                     EQU *            ; size:   $C (12)
  147.                         ENDR
  148.  
  149. ; typedef struct ccntTokenRecord  ccntTokenRecord, *ccntTokenRecPtr, **ccntTokenRecHandle
  150. ; typedef AEDesc             *DescPtr, **DescHandle
  151. ; typedefs providing type checking for procedure pointers 
  152. ;
  153. ; pascal OSErr AEObjectInit(void)
  154. ;
  155.     IF GENERATINGCFM THEN
  156.         IMPORT_CFM_FUNCTION    AEObjectInit
  157.     ENDIF
  158.  
  159. ; Not done by inline, but by direct linking into code.  It sets up the pack
  160. ;  such that further calls can be via inline 
  161. ;
  162. ; pascal OSErr AESetObjectCallbacks(OSLCompareUPP myCompareProc, OSLCountUPP myCountProc, OSLDisposeTokenUPP myDisposeTokenProc, OSLGetMarkTokenUPP myGetMarkTokenProc, OSLMarkUPP myMarkProc, OSLAdjustMarksUPP myAdjustMarksProc, OSLGetErrDescUPP myGetErrDescProcPtr)
  163. ;
  164.     IF ¬ GENERATINGCFM THEN
  165.         Macro
  166.         _AESetObjectCallbacks
  167.             move.w    #$0E35,d0
  168.             dc.w     $A816
  169.         EndM
  170.     ELSE
  171.         IMPORT_CFM_FUNCTION    AESetObjectCallbacks
  172.     ENDIF
  173.  
  174. ;
  175. ; pascal OSErr AEResolve(const AEDesc *objectSpecifier, short callbackFlags, DescPtr theToken)
  176. ;
  177.     IF ¬ GENERATINGCFM THEN
  178.         Macro
  179.         _AEResolve
  180.             move.w    #$0536,d0
  181.             dc.w     $A816
  182.         EndM
  183.     ELSE
  184.         IMPORT_CFM_FUNCTION    AEResolve
  185.     ENDIF
  186.  
  187. ;
  188. ; pascal OSErr AEInstallObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorUPP theAccessor, long accessorRefcon, Boolean isSysHandler)
  189. ;
  190.     IF ¬ GENERATINGCFM THEN
  191.         Macro
  192.         _AEInstallObjectAccessor
  193.             move.w    #$0937,d0
  194.             dc.w     $A816
  195.         EndM
  196.     ELSE
  197.         IMPORT_CFM_FUNCTION    AEInstallObjectAccessor
  198.     ENDIF
  199.  
  200. ;
  201. ; pascal OSErr AERemoveObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorUPP theAccessor, Boolean isSysHandler)
  202. ;
  203.     IF ¬ GENERATINGCFM THEN
  204.         Macro
  205.         _AERemoveObjectAccessor
  206.             move.w    #$0738,d0
  207.             dc.w     $A816
  208.         EndM
  209.     ELSE
  210.         IMPORT_CFM_FUNCTION    AERemoveObjectAccessor
  211.     ENDIF
  212.  
  213. ;
  214. ; pascal OSErr AEGetObjectAccessor(DescType desiredClass, DescType containerType, OSLAccessorUPP *accessor, long *accessorRefcon, Boolean isSysHandler)
  215. ;
  216.     IF ¬ GENERATINGCFM THEN
  217.         Macro
  218.         _AEGetObjectAccessor
  219.             move.w    #$0939,d0
  220.             dc.w     $A816
  221.         EndM
  222.     ELSE
  223.         IMPORT_CFM_FUNCTION    AEGetObjectAccessor
  224.     ENDIF
  225.  
  226. ;
  227. ; pascal OSErr AEDisposeToken(DescPtr theToken)
  228. ;
  229.     IF ¬ GENERATINGCFM THEN
  230.         Macro
  231.         _AEDisposeToken
  232.             move.w    #$023A,d0
  233.             dc.w     $A816
  234.         EndM
  235.     ELSE
  236.         IMPORT_CFM_FUNCTION    AEDisposeToken
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal OSErr AECallObjectAccessor(DescType desiredClass, const AEDesc *containerToken, DescType containerClass, DescType keyForm, const AEDesc *keyData, DescPtr token)
  241. ;
  242.     IF ¬ GENERATINGCFM THEN
  243.         Macro
  244.         _AECallObjectAccessor
  245.             move.w    #$0C3B,d0
  246.             dc.w     $A816
  247.         EndM
  248.     ELSE
  249.         IMPORT_CFM_FUNCTION    AECallObjectAccessor
  250.     ENDIF
  251.  
  252.     ENDIF ; __AEOBJECTS__
  253.